const toFriendlyTime = (n) => {
  const date = new Date(n);
  const dateString = date.toLocaleDateString();
  const timeString = date.toLocaleTimeString();
  return `${dateString} ${timeString}`;
};

const getTimestampOfToday = () => {
  const d = new Date();
  return (new Date(d.getFullYear(), d.getMonth(), d.getDate())).getTime();
};

module.exports = {
  toFriendlyTime: toFriendlyTime,
  getTimestampOfToday: getTimestampOfToday,
};
